home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / gmice.com / M_HANDLE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-06-16  |  1.7 KB  |  58 lines

  1. /* $Header:   C:/SRC/MOUSE/PVCS/M_HANDLE.C_V   1.3   12 Jun 1989 21:34:36  $
  2.     Dwight N. Tovey (adapted from the July/August 1988 issue of TURBO TECHNIX.
  3.  
  4.     This file contains the mouse interrupt handler.  On entry, the ax - dx
  5.     registers are saved into temporary variables. A pointer to the Program
  6.     Segment Prefix is established and the register values are stuffed into
  7.     a structure there. (This area is defined in "GMOUSCUR.I")
  8.  
  9.     NOTE: Because of the inline assembly code, this module must be compiled
  10.     with MS QuickC V2.0, or any other compiler that understands assembly.
  11.  
  12. $Log:   C:/SRC/MOUSE/PVCS/M_HANDLE.C_V  $
  13. /* 
  14. /*    Rev 1.3   12 Jun 1989 21:34:36
  15. /* Changed handler definition to use the 'interrupt' attribute.
  16. /* Changed save area for regs to be a external global variable instead
  17. /* of trying to use the PSP.
  18. /* Removed all in-line assembly code.
  19. /* Removed handler_init function.
  20. /* 
  21. /* 
  22. /*    Rev 1.2   31 May 1989 20:44:36
  23. /* Mouse interrupt handler routine.
  24. /* 
  25. /* 
  26. /*    Rev 1.1   28 May 1989  6:27:52
  27. /* Corrected error of not pointing to PSP area before trying to stuff
  28. /* values into it.
  29. /* 
  30. /* 
  31. /*    Rev 1.0   21 May 1989  6:59:30
  32. /* Initial revision.
  33. */
  34. #include <stdlib.h>
  35. #include <dos.h>
  36.  
  37. #include "gmouscur.h"
  38.  
  39. extern EVENTREC theEvents;      /* Pointer to save area in diff segment. */
  40.  
  41. static void interrupt cdecl far mouse(
  42.     es, ds, di, si, bp, sp, bx, dx, cx, ax, ip, cs, flags )
  43. unsigned es, ds, di, si, bp, sp, bx, dx, cx, ax, ip, cs, flags;
  44.     /* Event handler called by dummy handler function (below). */
  45. {
  46.     theEvents.flag = ax;               /* Save registers */
  47.     theEvents.button = bx;
  48.     theEvents.col = cx;
  49.     theEvents.row = dx;
  50. }
  51.  
  52.  
  53. void far handler()
  54. {
  55.     mouse();
  56. }
  57.  
  58.